package org.jeecg.modules.data.entity;

import lombok.Data;
import org.jeecg.modules.system.model.SysDepartTreeModel;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class DistrictTree implements Serializable {

    private static final long serialVersionUID = 1L;

    /** 对应SysDepart中的id字段,前端数据树中的key*/
    private String key;

    /** 对应SysDepart中的id字段,前端数据树中的value*/
    private String value;

    /** 对应depart_name字段,前端数据树中的title*/
    private String title;

    private boolean isLeaf;
    private String id;

    public DistrictTree (District district) {
        this.id = district.getCantCode();
        this.key = district.getCantCode();
        this.value = district.getCantCode();
        this.title = district.getCantName();
        this.cantCode = district.getCantCode();
        this.cantName = district.getCantName();
        this.shortName = district.getShortName();
        this.cantType = district.getCantType();
        this.superCode = district.getSuperCode();
        this.countryCode = district.getCountryCode();
        this.cantNote = district.getCantNote();
        this.inUse = district.getInUse();
        this.orderno = district.getOrderno();
        this.directorUserIds = district.getDirectorUserIds();
        this.officialSeal = district.getOfficialSeal();
    }
    private String cantCode;
    private String cantName;
    private String shortName;
    private String cantType;
    private String superCode;
    private String countryCode;
    private String cantNote;
    private String inUse;
    private Integer orderno;
    private String directorUserIds;
    private String officialSeal;

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public boolean isLeaf() {
        return isLeaf;
    }

    public void setLeaf(boolean leaf) {
        isLeaf = leaf;
    }

    public String getCantCode() {
        return cantCode;
    }

    public void setCantCode(String cantCode) {
        this.cantCode = cantCode;
    }

    public String getCantName() {
        return cantName;
    }

    public void setCantName(String cantName) {
        this.cantName = cantName;
    }

    public String getShortName() {
        return shortName;
    }

    public void setShortName(String shortName) {
        this.shortName = shortName;
    }

    public String getCantType() {
        return cantType;
    }

    public void setCantType(String cantType) {
        this.cantType = cantType;
    }

    public String getSuperCode() {
        return superCode;
    }

    public void setSuperCode(String superCode) {
        this.superCode = superCode;
    }

    public String getCountryCode() {
        return countryCode;
    }

    public void setCountryCode(String countryCode) {
        this.countryCode = countryCode;
    }

    public String getCantNote() {
        return cantNote;
    }

    public void setCantNote(String cantNote) {
        this.cantNote = cantNote;
    }

    public String getInUse() {
        return inUse;
    }

    public void setInUse(String inUse) {
        this.inUse = inUse;
    }

    public Integer getOrderno() {
        return orderno;
    }

    public void setOrderno(Integer orderno) {
        this.orderno = orderno;
    }

    private List<DistrictTree> children = new ArrayList<>();
    public List<DistrictTree> getChildren() {
        return children;
    }

    public void setChildren(List<DistrictTree> children) {
        if (children==null){
            this.isLeaf=true;
        }
        this.children = children;
    }

    public boolean getIsLeaf() {
        return isLeaf;
    }

    public void setIsLeaf(boolean isleaf) {
        this.isLeaf = isleaf;
    }

    public String getDirectorUserIds() {
        return directorUserIds;
    }

    public void setDirectorUserIds(String directorUserIds) {
        this.directorUserIds = directorUserIds;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getOfficialSeal() {
        return officialSeal;
    }

    public void setOfficialSeal(String officialSeal) {
        this.officialSeal = officialSeal;
    }
}
